package com.kunsan.compose.widget

import androidx.compose.foundation.Image
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Icon
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import com.kunsan.compose.R

@Composable
fun ToggleCameraAction(
    modifier: Modifier = Modifier,
    isCameraMuted: Boolean,
    enabled: Boolean = true,
    onCallAction: (Boolean) -> Unit,
) {
    val cameraIcon =
        painterResource(
            id = if (isCameraMuted) {
                R.drawable.icon_chat_video_off
            } else {
                R.drawable.icon_chat_video_on
            },
        )

    Image(
        modifier = Modifier
            .clickable(enabled = enabled) {
                onCallAction(
                    isCameraMuted.not(),
                )
            },
        painter = cameraIcon,
        contentDescription = "",
        contentScale = ContentScale.Crop
    )
//    CallControlActionBackground(
//        modifier = modifier
//    ) {
//
//    }
}
